<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // exec 是正则的方法
        //    找到与正则匹配的内容 , 找到与子正则匹配的内容


        // 正则中带括号的内容叫做子正则

        const str = 'good good study' ;

        const reg = /g(oo)d/ ;

        console.log(reg.exec(str));   // ['good' , 'oo']

    </script>
    
</body>
</html>